import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsEmail, IsEnum, IsMobilePhone, IsNotEmpty } from "class-validator";
export class UserResumeDto {
    @IsNotEmpty({ message: '用户名不能为空' })
    @ApiProperty({
        type: String,
        name: 'name',
        description: '用户名',
    })
    public readonly name: string
    
    @IsEnum(['男', '女', '未知'], {message: '只能传入男, 女, 未知'}) //枚举
    @IsNotEmpty({ message: '性别不能为空' })
    @ApiProperty({
        type: String,
        name: 'sex',
        example: '未知',
        description: '性别',
        enum: ['男', '女', '未知'],
    })
    public readonly sex: string

    @IsNotEmpty({ message: '籍贯不能为空' })
    @ApiProperty({
        type: String,
        name: 'nativePlace',
        description: '籍贯',
    })
    public readonly nativePlace: string

    @IsEmail()
    @IsNotEmpty({ message: '邮箱不能为空' })
    @ApiProperty({
        type: String,
        name: 'mail',
        description: '邮箱',
    })
    public readonly mail: string

    @IsNotEmpty({ message: '学历不能为空' })
    @ApiProperty({
        type: String,
        name: 'education',
        description: '学历',
    })
    public readonly education: string

    @IsMobilePhone()
    @IsNotEmpty({ message: '电话不能为空' })
    @ApiProperty({
        type: String,
        name: 'phone',
        description: '电话',
    })
    public readonly phone: string

    @IsNotEmpty({ message: '工作经验不能为空' })
    @ApiProperty({
        type: String,
        name: 'experience',
        description: '工作经验',
    })
    public readonly experience: string

    @IsNotEmpty({ message: '职业不能为空' })
    @ApiProperty({
        type: String,
        name: 'occupation',
        description: '职业',
    })
    public readonly occupation: string

    @ApiPropertyOptional({
        type: String,
        name: 'PDFUrl',
        description: 'PDF下载地址',
    })
    public readonly PDFUrl: string

    @IsNotEmpty({ message: '用户id不能为空' })
    @ApiProperty({
        type: Number,
        name: 'userId',
        description: '用户id',
    })
    public readonly userId: number
    
}
export class ResumeIdDto {
    @IsNotEmpty({ message: '简历ID不能为空' })
    @ApiProperty({
        type: Number,
        name: 'resumeId',
        description: '简历ID',
    })
    public readonly resumeId: number

    @IsNotEmpty({ message: '用户id不能为空' })
    @ApiProperty({
        type: Number,
        name: 'userId',
        description: '用户id',
    })
    public readonly userId?: number
}
export class GetUserResumeInfoDto {
    @IsNotEmpty({ message: '用户id不能为空' })
    @ApiProperty({
        type: Number,
        name: 'userId',
        description: '用户id',
    })
    public readonly userId: number

    @ApiPropertyOptional({
        type: Number,
        name: 'id',
        description: '简历id',
    })
    public readonly id?: number
}

export class UpdateUserResumeDto extends UserResumeDto { }

export class UpdateUserImageDto extends GetUserResumeInfoDto {
    @IsNotEmpty({ message: '头像地址不能为空' })
    @ApiProperty({
        type: String,
        name: 'userImage',
        description: '头像地址',
    })
    public readonly userImage: string
}

